#ifndef __mid_sysbackup_h__
#define __mid_sysbackup_h__

#include "types.h"
#include "mid_flash_driver.h"

/***************************************************************************************************************************/
// 1. ��������ĵ�ַ����
#define	FLASH_SECTOR_SIZE		4096 //FMC_FLASH_PAGE_SIZE

/***************************************************************************************************************************/
// 2. ������������ݽṹ����

typedef struct {
	uint16_t count_reset;
	uint16_t count_wakeup;
}Sysboot_Backup_t;

typedef struct {
	uint32_t u32updataFlag; 	
}struct_DID_Logistics_t;

typedef struct {
	/*	g_DiagDidLogistics ���������Ҫ������ǰ�� 	*/
	struct_DID_Logistics_t g_DiagDidLogistics;
	
	// Sysboot_Backup_t g_sysboot_backup;
	
	//union_Dtc_t           g_Dtc;

}struct_sysbackup_t;


extern struct_sysbackup_t g_sysbackup __attribute__((aligned(4)));;
extern flash_ssd_config_t flashSSDConfig;


/***************************************************************************************************************************/
// 3. �������� Ӧ�ýӿ�

uint32_t mid_sysbackup_init(void);
uint32_t mid_sysbackup_deinit(void);

uint32_t mid_sysbackup_readall(void);

uint32_t mid_sysbackup_writeItem(uint32_t addr, uint32_t size);

#endif

